<?php


namespace app\server\controller;

use app\index\controller\Base;//application统一的模式，不要修改
use app\server\model\ServerClass as ServerClassModel;  //引入model.
class Serverclass extends Base
{

    public function get(){
        $user = new ServerClassModel();
        $data=$this->request->param();
        $res=$user->where($data['field'],$data['op'],$data['value'])
        ->order('order desc')
        ->select();
        return $res;
    }
    public function update()
    {
        $data = $this->request->param();
        $res = new ServerClassModel();
        return $res->updateModel($data);
    }
    public function delete(){
        $data = $this->request->param();
        $res = new ServerClassModel();
        return $res->deleteModel($data);
    }
    public function save(){
        $res = new ServerClassModel();
        $data = $this->request->param();
        $res->saveModel($data);
    }
    public function num(){
        $data = $this->request->param();
        $res =new ServerClassModel();
        return $res->where($data['field'],$data['op'],$data['value'])->count();
    }
}